<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改任务')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-taskMission-edit" th:object="${taskPostpone}">
        <input id="postponeId" name="postponeId" type="hidden" th:field="${taskPostpone.postponeId}"/>
        <div class="form-group">
            <label class="col-sm-3 control-label">任务标题：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="missionTitle" id="missionTitle" th:field="${taskPostpone.taskMission.missionTitle}" required readonly="true">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">任务内容：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="missionText" id="missionText" th:field="${taskPostpone.taskMission.missionText}" required readonly="true">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">申请人：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="infoId" id="infoId" th:field="${taskPostpone.personInfo.infoName}" required readonly="true">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label ">完成时间：</label>
            <div class="col-sm-4">
                <input class="form-control" type="datetime-local" name="createTime" id="createTime"  th:value="${#dates.format(taskPostpone.taskMission.createTime,'yyyy-MM-dd')}+'T'+${#dates.format(taskPostpone.taskMission.createTime,'HH:mm:ss')}" required readonly="true">
            </div>
            <div class="col-sm-4">
                <input class="form-control" type="datetime-local" name="endTime" id="endTime" th:value="${#dates.format(taskPostpone.taskMission.endTime,'yyyy-MM-dd')}+'T'+${#dates.format(taskPostpone.taskMission.endTime,'HH:mm:ss')}" required readonly="true">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label ">延期时间：</label>
            <div class="col-sm-8">
                <input class="form-control" type="date"   th:value="${#dates.format(taskPostpone.postponeTime,'yyyy-MM-dd')}" required>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">延期理由：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="postponeText" id="postponeText" th:field="${taskPostpone.postponeText}" required>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label ">审批人：</label>
            <div class="col-sm-8">
                <select name="giveName"  class="form-control" id="infoId">
                    <option>请选择审批人</option>
                    <option th:each="person : ${list}" th:value="${person.infoName}" th:text="${person.infoName}"></option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">是否同意：</label>
            <div class="col-sm-9">

                <label class="radio-box">
                    <input type="radio"
                           th:checked="${taskPostpone.giveState eq '1'}"
                           id="optionsRadios1" name="giveState"  value="1" style="position: absolute; opacity: 0;">
                    同意
                </label>

                <label class="radio-box">
                    <input type="radio"
                           th:checked="${taskPostpone.giveState eq '0'}"
                           id="option2" name="giveState"  value="0" style="position: absolute; opacity: 0;">
                    不同意
                </label>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">延期至：</label>
            <div class="col-sm-8">
                <input class="form-control" type="date" name="postponeTime" id="postponeTime"  required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">备注：</label>
            <div class="col-sm-8">
                <textarea id="remark" name="remark" class="form-control">[[*{remark}]]</textarea>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<script type="text/javascript">
    var prefix = ctx + "task/ratify";

    $("#form-taskMission-edit").validate({
        onkeyup: false,
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-taskMission-edit').serialize());
        }
    }
</script>
</body>
</html>
